<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> 

<portlet:defineObjects />

<fmt:setLocale value="<%= renderResponse.getLocale().getLanguage() %>"/>
<fmt:setBundle basename="Language" var="msg"/>
<fmt:message bundle="${"${"}msg}" key="title" scope="session" var="title1" />
<% renderResponse.setTitle( (String)session.getAttribute("title1") ); %>

<f:view locale="${"#{"}facesContext.externalContext.request.locale}">

<f:loadBundle basename="Language" var="msgs" />

<%@ include file="navigation.jspf"%>

<h:messages/>

<h:form>
<#foreach field in pojo.getAllPropertiesIterator()>
<#if pojo.getJavaTypeName(field, jdk5).equals("String")>
	<h:inputText value="${"#{"}${pojo.getDeclarationName()?uncap_first}Bean.${pojo.getDeclarationName()?uncap_first}.${field.name}}">${field.name}:</h:inputText><hr/>
</#if>
</#foreach>

<#foreach field in pojo.getAllPropertiesIterator()>
<#if pojo.getJavaTypeName(field, jdk5).equals("Set<String>")>

	<h:outputFormat rendered="${"#{"}!${pojo.getDeclarationName()?uncap_first}Bean.categoryHaveListEmpty}" value="${"#{"}msgs.the_record_current_have}">
		<f:param value="category"/>
	</h:outputFormat>
	<h:dataTable rendered="${"#{"}!${pojo.getDeclarationName()?uncap_first}Bean.categoryHaveListEmpty}" value="${"#{"}${pojo.getDeclarationName()?uncap_first}Bean.categoryHaveList}" var="item" border="1">
		<%@ include file="../Category/tableColumn.jspf"%>
		<h:column>
			<f:facet name="remove">
				<h:outputText value="remove" />
			</f:facet> 
				<h:commandLink action="${"#{"}${pojo.getDeclarationName()?uncap_first}Bean.removeCategoryAction}" value="remove">
					<f:param name="category_id" value="${"#{"}item.id}"/>
				</h:commandLink>
		</h:column>
	</h:dataTable>

	<h:outputFormat rendered="${"#{"}!${pojo.getDeclarationName()?uncap_first}Bean.categoryNoneListEmpty}" value="${"#{"}msgs.the_record_donot_have}">
		<f:param value="category"/>
	</h:outputFormat>
	<h:dataTable rendered="${"#{"}!${pojo.getDeclarationName()?uncap_first}Bean.categoryNoneListEmpty}" value="${"#{"}${pojo.getDeclarationName()?uncap_first}Bean.categoryNoneList}" var="item" border="1">
		<%@ include file="../Category/tableColumn.jspf"%>
		<h:column>
			<f:facet name="add">
				<h:outputText value="add" />
			</f:facet> 
				<h:commandLink action="${"#{"}${pojo.getDeclarationName()?uncap_first}Bean.addCategoryAction}" value="add">
					<f:param name="category_id" value="${"#{"}item.id}"/>
				</h:commandLink>
		</h:column>
	</h:dataTable>
</#if>
</#foreach>

	<h:commandLink action="${"#{"}${pojo.getDeclarationName()?uncap_first}Bean.updateAction}" value="${"#{"}msgs.button_update}"/>
</h:form>

</f:view>
